<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改话题')" />
	<th:block th:include="include :: select2-css" />
	<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-topic-edit" th:object="${topic}">
            <input id="id" name="id" th:field="*{id}"  type="hidden">
			<div class="form-group">	
				<label class="col-sm-2 control-label">创建用户：</label>
				<div class="col-sm-3">
					<input  th:value="${nickName}" class="form-control" type="text" readonly>
				</div>

				<label class="col-sm-2 control-label">话题名称：</label>
				<div class="col-sm-3">
					<input id="topicName" name="topicName" th:field="*{topicName}" class="form-control" type="text">
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-2 control-label">审核状态：</label>
				<div class="col-sm-3">

					<select id="verifyState" name="verifyState" class="form-control m-b"
							th:field="*{verifyState}">
						<option value=0>待审核</option>
						<option value=1>发布</option>
						<option value=2>隐藏</option>
					</select>
				</div>


				<label class="col-sm-2 control-label">话题种类：</label>
				<div class="col-sm-3">

					<select id="topicType" name="topicType" class="form-control m-b"
							th:field="*{topicType}">
						<option value=1>普通话题</option>
						<option value=2>官方话题</option>
					</select>
				</div>
			</div>



			<div class="form-group">	
				<label class="col-sm-2 control-label">浏览量：</label>
				<div class="col-sm-3">
					<input id="glanceNum" name="glanceNum" th:field="*{glanceNum}" class="form-control" type="text">
				</div>

				<label class="col-sm-2 control-label">回复量：</label>
				<div class="col-sm-3">
					<input id="responseNum" name="responseNum" th:field="*{responseNum}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-2 control-label">话题帖子量：</label>
				<div class="col-sm-3">
					<input id="topicPostNum" name="topicPostNum" th:field="*{topicPostNum}" class="form-control" type="text">
				</div>

				<label class="col-sm-2 control-label">话题等级：</label>
				<div class="col-sm-3">
					<input id="topicLevel" name="topicLevel" th:field="*{topicLevel}" class="form-control" type="number">
				</div>
			</div>
			<!--<div class="form-group">	-->
				<!--<label class="col-sm-3 control-label">有效值：</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input id="valid" name="valid" th:field="*{valid}" class="form-control" type="text">-->
				<!--</div>-->
			<!--</div>-->
			<div class="form-group">
				<label class="col-sm-2 control-label">话题简介：</label>
				<div class="col-sm-8">
					<textarea id="topicIntroduction" name="topicIntroduction" th:field="*{topicIntroduction}" class="form-control" type="text"></textarea>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-2 control-label">建立日期：</label>
				<div class="col-sm-3">
					<input id="createDate" name="createDate" th:value="${#dates.format(topic.createDate, 'yyyy-MM-dd HH:mm:ss')}" class="form-control" type="text" placeholder="yyyy-MM-dd HH:mm:ss" readonly>
				</div>
				<!--th:value="${#dates.format(topic.modifyDate, 'yyyy-MM-dd')}"-->

				<label class="col-sm-2 control-label">修改日期：</label>
				<div class="col-sm-3">
					<input id="modifyDate" name="modifyDate" th:value="${#dates.format(topic.modifyDate, 'yyyy-MM-dd HH:mm:ss')}" class="form-control" type="text"  readonly>
				</div>
			</div>
		</form>
    </div>
    <div th:include="include::footer"></div>
	<th:block th:include="include :: select2-js" />
	<th:block th:include="include :: datetimepicker-js" />
    <script type="text/javascript">
		var prefix = ctx + "topic/topic";
		$("#form-topic-edit").validate({
			rules:{
				xxxx:{
					required:true,
				},
			},
			focusCleanup: true
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/edit", $('#form-topic-edit').serialize());
	        }
	    }

		// $("#createDate").datetimepicker({
		// 	format: "yyyy-mm-dd hh:ii:ss",
		// 	autoclose: true
		// });
		//
		// $("#modifyDate").datetimepicker({
		// 	format: "yyyy-mm-dd hh:ii:ss",
		// 	autoclose: true
		// });
	</script>
</body>
</html>
